﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_ascx_MultiCheckTemplate : System.Web.UI.UserControl
{
    //public ConfigTable ThisTable = null;
    public string PkName = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        ConfigTable cTab = GetThisPageConfigTable();        
        PkName = cTab.PkFiledName;        
        if (string.IsNullOrEmpty(PkName))
        {
            PkName = "id";
        }
    }

    #region 获取此页的表设置
    public ConfigTable GetThisPageConfigTable()
    {
        //获取表名
        string tablename = Request.QueryString["tab"];
        //获取xml名
        string xmlname = Request.QueryString["xml"];
        //从xml文件读取配置
        string path = Server.MapPath("~/configs/tables/" + tablename + "/" + xmlname + ".xml");
        ConfigTable cTab = path.XmlToObj<ConfigTable>();
        return cTab;
    }
    #endregion
}
